package com.imooc.bilibili.exception;

/**
 * 异常实体类
 * RuntimeException：运行时异常
 */
public class ConditionException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    // 响应状态码
    private String code;

    public ConditionException(String code, String name) {
        super(name);
        this.code = code;
    }

    public ConditionException(String name) {
        super(name);
        // 常规的错误处理都使用500返回给前端
        code = "500";
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
